<template>
  <div class="scroll-top" @click="returnTop">
    <div class="box-in"></div>
  </div>
</template>
<script>
export default {
  name: 'scroll-top',
  methods: {
    returnTop() {
      document.documentElement.scrollTop = document.body.scrollTop = 0 //两个等于是为了让那个不同的浏览器兼容
    }
  }
}
</script>
<style lang="scss" scoped>
@import "../assets/css/scroll-top";
</style>
